package com.xdb.sqlparser.dialect.mysql.ast.statement;

import com.xdb.sqlparser.ast.statement.SQLAlterTableStatement;
import com.xdb.sqlparser.dialect.mysql.visitor.MySqlASTVisitor;
import com.xdb.sqlparser.visitor.SQLAstVisitor;
import com.xdb.util.JDBCConstants;

public class MySqlAlterTableStatement extends SQLAlterTableStatement {

	private boolean ignore = false;

	public MySqlAlterTableStatement() {
		super(JDBCConstants.MYSQL);
	}

	@Override
	protected void accept0(SQLAstVisitor visitor) {
		if (visitor instanceof MySqlASTVisitor) {
			accept0((MySqlASTVisitor) visitor);
		} else {
			throw new IllegalArgumentException("not support visitor type : " + visitor.getClass().getName());
		}
	}

	public void accept0(MySqlASTVisitor visitor) {
		if (visitor.visit(this)) {
			acceptChild(visitor, getTableSource());
			acceptChild(visitor, getItems());
		}
		visitor.endVisit(this);
	}

	public boolean isIgnore() {
		return ignore;
	}

	public void setIgnore(boolean ignore) {
		this.ignore = ignore;
	}

}
